#include "namegenerator.h"
#include <sstream>

namespace ZH
{
	size_t NameGenerator::GENER_COUNTER = 0;

	NameGenerator::NameGenerator(const std::string& pref) : m_Pref(pref), m_DetailGener(0)
	{
		m_Gener = ++ NameGenerator::GENER_COUNTER;
	}

	NameGenerator::~NameGenerator()
	{	}

	std::string NameGenerator::GenerateName()
	{
		std::stringstream stream;
		++ m_DetailGener;
		stream << m_Pref << "_" << m_Gener << "_" << m_DetailGener << "_";
		std::string name = stream.str();
		printf("namegenerator\t[%s]\n", name.c_str());
		return name;
	}
}	// end of namespace ZH
